/** 
*@Project: UIBase
*@�ļ����: ImageListAdapter.java 
*@Author: linlin.zou
*@Date: 2014-12-3 
*@Copyright: 2014 www.boshtc.com Inc. All rights reserved.

*ע�⣺�����ݽ������Ϻ�Ѽ���������޹�˾�ڲ����ģ���ֹ��й�Լ������������ҵĿ�� 
*/ 
package com.alipear.uibase;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.AdapterView;
import android.widget.BaseAdapter;

import java.util.ArrayList;
import java.util.List;

public abstract class ImageListAdapter<T> extends BaseAdapter implements
		AdapterView.OnItemSelectedListener {

	enum ImageListCurAniStep {
		None, Del, Add, Move
	};

	public List<T> list;
	protected  LayoutInflater inflater;


	public ImageListAdapter(Context c) {
	    init(c, null);
    }
	
	private void init(Context c,List<T>bl){
	    inflater = LayoutInflater.from(c);
	    if (bl == null) {
	        list =new ArrayList<T>();
	    }
	    else {
        list = bl;
	    }
	}
	
	public ImageListAdapter(Context c, List<T> bl) {
	    init(c, bl);
	}
	
	public void setList(List<T> bl) {
	    list = bl;
	    this.notifyDataSetChanged();
	}


	@Override
	public int getCount() {
		int count = 0;
		count = list.size();

		return count;
	}

	@Override
	public T getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}


	@Override
	public void onNothingSelected(AdapterView<?> arg0) {

	}


}
